# -*- coding: utf-8 -*-
from functools import partial
from common.lottery.cyclical.xj_ssc.model.activity import BET_TYPE
from common.lottery.cyclical.tj_ssc.logic import order as base   # 计算方法和天津时时彩一致

RATE_CONFIG = {         # base on UNIT==2
    BET_TYPE.ONE_SINGLE: 11,
    BET_TYPE.TWO_SINGLE: 100,
    BET_TYPE.THREE_SINGLE: 1160,
    BET_TYPE.FIVE_SINGLE: 116000,  #
    BET_TYPE.TWO_COMBINE: 58,
    BET_TYPE.THREE_GROUP_SINGLE: 386,
    BET_TYPE.THREE_GROUP_MULTI: 386,
    BET_TYPE.THREE_GROUP_SIX: 192,
    BET_TYPE.FIVE_ALL: [32480, 260, 20],    # 全部，前后三，前后二
    BET_TYPE.TWO_BSOE: '4.5',
    BET_TYPE.TWO_SUM: 98,
    BET_TYPE.CHOSEN_ONE: 11,  #
    BET_TYPE.FOUR_SINGLE: 9999,
}

UNIT = 2


def valid_number(bet_type, number):
    base.valid_number(bet_type, number)


def calc_total_price(bet_type, number, times=1, unit=UNIT):
    return base.calc_total_price(bet_type, number, times, unit)


def generate_win_func(number):
    return base.generate_win_func(number)


calc_win_price = partial(base.calc_win_price, rate_config=RATE_CONFIG)
